﻿using UnityEngine;
using System.Collections;

public class CharacterModel : MonoBehaviour {
	[SerializeField]
	public GameObject modelCharacter;
    [SerializeField]
    public GameObject _collisionDetecter;

    private CharacterController _cController;

    public CharacterController cController 
    {
        get { return _cController; }
        set { _cController = value; }
    }

    private BoxCollider _bxCollider;

    public BoxCollider bxcCollider
    {
        get { return _bxCollider; }
        set { _bxCollider = value; }
    }
	private Character classCharacther;

    void Start()
    {
        cController = modelCharacter.GetComponent<CharacterController>();
        bxcCollider = _collisionDetecter.GetComponent<BoxCollider>();
    }

	public Character GetCharacther()
	{
		if(classCharacther == null)
			classCharacther = new Character();
		return classCharacther;
	}
	
	public GameObject GetModelcharacther()
	{
		return modelCharacter;
	}

	/*
	public void OnTriggerEnter(Collider other)
	{
		switch(other.tag)
		{
			case "Element":
				ScreenGeneral.Neko.Action = EnumTypes.CharactherAction.PickUp;
				Element test = other.GetComponent<ElementModel>().GetElement();
				ScreenGeneral.CollisionElement = test;//other.gameObject.GetComponentInChildren(Element);
				break;
			case "NPC":
				ScreenGeneral.Neko.Action = EnumTypes.CharactherAction.Talk;
				break;
		}
	}
	
	public void OnTriggerStay(Collider other)
	{
		if(ScreenGeneral.CollisionElement == null)
		{
            Debug.Log(other.tag);
			if(other.gameObject.CompareTag("Element"))
				Destroy(other.gameObject);
		}
	}
	
	public void OnTriggerExit(Collider other)
	{
		ScreenGeneral.CollisionElement = null;
		ScreenGeneral.Neko.Action = EnumTypes.CharactherAction.Walk;
	}
    */
}
